<%@page contentType="text/html;charset=utf-8"%>
<%@page trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="renderer" content="webkit">
<!--[if lt IE 10]>
<meta http-equiv="refresh" content="0;${CTX}/static/html/mgt/core/ie.html" />
<![endif]-->
<title>${PARAM.project}</title>
<link href="${CTX}/static/img/mgt/core/favicon.ico" rel="shortcut icon">
<link href="${CTX}/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="${CTX}/static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="${CTX}/static/plugins/hplus/css/style.css" rel="stylesheet">
<link href="${CTX}/static/plugins/hplus/css/login.css" rel="stylesheet">
<link href="${CTX}/static/css/mgt/core/login.css" rel="stylesheet">
<link href="${CTX}/static/css/mgt/core/common.css" rel="stylesheet">
<script src="${CTX}/static/plugins/jquery/jquery.min.js"></script>
<script src="${CTX}/static/plugins/rsa/jsencrypt.min.js"></script>
<script src="${CTX}/static/plugins/rsa/key.js"></script>
<script src="${CTX}/static/plugins/pace/pace.min.js"></script>
</head>
<script>
	if (window.top !== window.self) {
		window.top.location = window.location;
	}
</script>
<body class="signin">
	<div class="signinpanel">
		<div class="row">
			<div class="col-sm-6">
				<div class="signin-info">
					<div class="logopanel m-b">
						<h1>${PARAM.project}</h1>
					</div>
					<ul class="m-b">
						<li>
							<i class="fa fa-check-square-o m-r-10"></i>出库管理
						</li>
						<li>
							<i class="fa fa-check-square-o m-r-10"></i>入库管理
						</li>
						<li>
							<i class="fa fa-check-square-o m-r-10"></i>库存管理
						</li>
					</ul>
				</div>
			</div>
			<div class="col-sm-6">
				<form id="fm" method="post">
					<input name="account" type="hidden">
					<input name="password" type="hidden">
					<h4 class="no-margins">欢迎使用</h4>
					<p class="m-t-md">登录到${PARAM.project}</p>
					<input id="account" type="text" class="form-control uname" placeholder="帐号" />
					<input id="password" type="password" class="form-control pword" placeholder="密码" />
					<div class="login-tips" error="${param.error}">
						<i class="fa fa-exclamation-circle m-t m-r-5"></i><span>帐号或密码错误</span>
					</div>
					<a id="login" class="btn btn-success btn-block">登录</a>
				</form>
			</div>
		</div>
		<div class="signup-footer">
			<div class="pull-left">© ${PARAM.copyright}</div>
		</div>
	</div>
</body>
<script>
	$(function() {
		$('#login').click(function() {
			if (!$('#account').val()) {
				$('.login-tips').attr('error', true);
				$('.login-tips span').text('请输入帐号');
				$('#account').focus();
				return;
			}
			if (!$('#password').val()) {
				$('.login-tips').attr('error', true);
				$('.login-tips span').text('请输入密码');
				$('#password').focus();
				return;
			}
			var rsa = new JSEncrypt();
			rsa.setPublicKey(RAS.PUBLIC_KEY);
			$('input[name="account"]').val(rsa.encrypt($('#account').val()));
			$('input[name="password"]').val(rsa.encrypt($('#password').val()));
			$('#fm').submit();
		});
		$('body').keydown(function(e) {
			if (e.keyCode == '13') {
				$('#account').focus();
			}
		});
		$('#account').keydown(function(e) {
			if (e.keyCode == '13') {
				$('#password').focus();
				return false;
			}
		});
		$('#password').keydown(function(e) {
			if (e.keyCode == '13') {
				$('#login').click();
				return false;
			}
		});
	});
</script>
</html>